<template>
    <view class="page">
        <!-- <view class="box">
            <view class="price"> <text style="color:#fff;font-size: 54rpx;">19898.00</text> 元</view>
            <view class="text">今日收益</view>
        </view> -->
        <view class="tab">
            <view class="tab_1" @click="toList">
                <view><text style="font-size: 36rpx;">设</text>备管理</view>

            </view>
            <view class="tab_2" @click="to(1)">
                <view>
                    <text style="font-size: 36rpx;">报</text>表中心
                </view>

            </view>
        </view>
        <view class="to">
            <view class="item" @click="to(10)">
                <view>个人信息</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(3)">
                <view>车队列表</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(2)">
                <view>车辆列表</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(5)">
                <view>运输物料</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(6)">
                <view>运输路线</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(7)">
                <view>吨位立方</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(8)">
                <view>运输里程</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(9)">
                <view>装卸人员</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>
            <view class="item" @click="to(4)">
                <view>退出账号</view>
                <view><u-icon name="arrow-right" color="#007aff"></u-icon></view>
            </view>

        </view>
    </view>
</template>

<script>
export default {
    components: {},
    props: {},
    data() {
        return {
            type: ''
        };
    },
    watch: {},
    methods: {
        toList() {
            uni.navigateTo({ url: '/pages/manufacturer/list' })
        },
        toOrder() {
            uni.navigateTo({ url: '/pages/manufacturer/orderList' })
        },
        to(index) {
            switch (index) {
                case 1:
                    uni.navigateTo({ url: '/pages/manufacturer/total' })
                    break;
                case 2:
                    uni.navigateTo({ url: '/pages/manufacturer/cartList' })
                    break;
                case 3:
                    uni.navigateTo({ url: '/pages/manufacturer/userList' })
                    break;
                case 4:
                    uni.showModal({
                        title: '提示',
                        content: '确认退出账号吗?',
                        showCancel: true,
                        success: ({ confirm, cancel }) => {
                            if (confirm) {
                                uni.clearStorageSync()
                                uni.reLaunch({ url: '/pages/index/index' })
                            }
                        }
                    })
                    break;
                case 5:
                    uni.navigateTo({ url: '/pages/manufacturer/disposition?type=1' })
                    break;
                case 6:
                    uni.navigateTo({ url: '/pages/manufacturer/line' })
                    break;
                case 7:
                    uni.navigateTo({ url: '/pages/manufacturer/disposition?type=3' })
                    break;
                case 8:
                    uni.navigateTo({ url: '/pages/manufacturer/disposition?type=4' })
                    break;
                case 9:
                    uni.navigateTo({ url: '/pages/manufacturer/unloadList' })
                    break;
                case 10:
                    uni.navigateTo({ url: '/pages/manufacturer/userInfo' })
                    break;
            }
        }
    },
    onShow() { },
    onLoad(option) {
        console.log(option)
        switch (Number(option.type)) {
            case 5:
                uni.setNavigationBarTitle({ title: '厂家' })
                break;
            case 4:
                uni.setNavigationBarTitle({ title: '商户' })
                break;
            case 3:
                uni.setNavigationBarTitle({ title: '车队队长' })
                break;
            case 2:
                uni.setNavigationBarTitle({ title: '运输车车主' })
                break;
        }
    },
};
</script>
<style scoped lang='scss'>
.page {
    background-color: #efefef;
    width: 100%;
    min-height: 100vh;
}

.box {

    height: 350rpx;
    width: 100%;
    background: $uni-color-primary;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
    margin: auto;
    // border-top-left-radius: 20rpx;
    // border-top-right-radius: 20rpx;
    // margin-top: 30rpx;

    .price {
        font-size: 46rpx;
        text-align: center;
        padding-top: 100rpx;
        color: #fff;
        // margin-top: 100rpx;
    }

    .text {
        text-align: center;
        padding-top: 20rpx;
        color: #fff;
    }
}

.tab {
    width: 100%;
    height: 200rpx;
    background-color: #fff;
    display: flex;

    .tab_1 {
        width: 45%;
        background-color: $uni-color-primary;
        height: 160rpx;
        margin: auto;
        border-radius: 20rpx;
        text-align: center;
        color: #Fff;
        line-height: 160rpx;
    }

    .tab_2 {
        width: 45%;
        background-color: $uni-color-primary;
        height: 160rpx;
        margin: auto;
        border-radius: 20rpx;
        text-align: center;
        color: #Fff;
        line-height: 160rpx;
    }
}

.to {
    width: 96%;
    background-color: #fff;
    margin: auto;
    margin-top: 30rpx;

    .item {
        display: flex;
        height: 80rpx;
        line-height: 80rpx;
        border-bottom: 1px solid #efefef;

        view:nth-child(1) {
            width: 90%;
            padding-left: 30rpx;
            font-size: 28rpx;
            color: #333;
        }

        view:nth-child(2) {
            width: 10%;
            margin-top: 20rpx;
            line-height: 80rpx;
            padding-right: 20rpx;
            // text-align: right;
        }
    }
}
</style>